var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, n, o) {
    var i, a = arguments.length, r = a < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, o); else for (var c = e.length - 1; 0 <= c; c--) (i = e[c]) && (r = (a < 3 ? i(r) : 3 < a ? i(t, n, r) : i(t, n)) || r);
    return 3 < a && r && Object.defineProperty(t, n, r), r;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("PrefabView"), c = e("AudioManager"), l = e("GameConfig"), d = e("GameData"), u = e("EggsManager"), p = e("DataManager"), h = e("UIManager"), f = e("WebManager"), g = cc._decorator, m = g.ccclass, y = g.property, v = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.pageView = null, e.pageViewList = [], e.layout = null, e.item = null, e.codes = [], 
        e.idx = 12, e;
    }
    return i(e, t), e.prototype.onLoad = function() {
        -1 == u.default.getInstance().checkEggPerson(this.idx) && this.init();
    }, e.prototype.onClickBack = function() {
        c.default.getInstance().playAudio("按钮2"), f.default.getInstance().sentLog("点击密码箱界面返回按键"), 
        this.hidePnl();
    }, e.prototype.onScroll = function(e) {
        var t;
        -1 == u.default.getInstance().checkEggPerson(this.idx) && (f.default.getInstance().sentLog("触发皮肤彩蛋id:" + this.idx), 
        -1 < (t = this.pageViewList.indexOf(e)) && (this.codes[t] = e.getCurrentPageIndex(), 
        this.check() && (f.default.getInstance().sentLog("获得皮肤彩蛋id:" + this.idx), this.callback())));
    }, e.prototype.start = function() {
        cc.tween(this.node).to(.1, {
            scale: 1.1
        }).to(.1, {
            scale: 1
        }).start();
    }, e.prototype.init = function() {
        for (var e, t = 0; t < 10; t++) (e = cc.instantiate(this.item.node)).getComponent(cc.Label).string = t.toString(), 
        e.active = !0, e.parent = this.pageView.content;
        for (this.pageViewList.push(this.pageView), this.codes.push(this.pageView.getCurrentPageIndex()), 
        t = 0; t < 2; t++) {
            (e = cc.instantiate(this.pageView.node)).parent = this.layout;
            var n = e.getComponent(cc.PageView);
            this.pageViewList.push(n), this.codes.push(n.getCurrentPageIndex());
        }
    }, e.prototype.check = function() {
        return this.codes.every(function(e, t) {
            return e == l.GC.eggCode[t];
        });
    }, e.prototype.callback = function() {
        var e = this;
        u.default.getInstance().updateEggPerson(this.idx), d.GD.personIdx = -1 - this.idx, 
        d.GD.eggsHintState = 1, p.default.getInstance().save(), h.default.getInstance().loadPopPnl("egg_reward", {
            type: r.RewardType.SKIN,
            idx: this.idx
        }, function() {
            e.hidePnl();
        });
    }, a([ y(cc.PageView) ], e.prototype, "pageView", void 0), a([ y(cc.Node) ], e.prototype, "layout", void 0), 
    a([ y(cc.Label) ], e.prototype, "item", void 0), a([ m ], e);
}(s.default);

n.default = v;